package com.itmanager.console;

import com.itmanager.console.autoconfig.EnableEchoServerFlag;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.web.servlet.ServletContextInitializer;

import javax.servlet.ServletContext;
import javax.servlet.ServletException;

@ConditionalOnBean(EnableEchoServerFlag.class)
public class EchoServer implements ServletContextInitializer {

    public void run() {
        System.out.println("启动EchoServer服务");
    }

    @Override
    public void onStartup(ServletContext servletContext) throws ServletException {
        run();
    }
}
